package com.example.tts.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

import com.blankj.utilcode.util.LogUtils;
import com.example.tts.service.AutoStartService;

public class BootCompletedReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())){
            //开机启动一个倒计时服务，倒计时5分钟之后跳转应用
            LogUtils.e("开机广播");
            Intent splashIntent = new Intent(context, AutoStartService.class);
            context.startService(splashIntent);
        }
    }
}
